
package View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;


public class PageActionListener implements MouseListener {
    private String name;
    private MainMenu main;
    private AddCharacterForm current;
    public String selectedCharacterType = "";

    public PageActionListener(String page, MainMenu main, AddCharacterForm form) {
        this.name = page;
        this.main = main;
        this.current = form;
        selectedCharacterType = this.current.selectedCharacterType;
    }

    public void mouseClicked(MouseEvent e) {

        if (e.getClickCount() == 2){
            setPage(name);
            System.out.println(this.name);
            main.addImage(name,selectedCharacterType);
            current.dispose();
        }
    }
    
    public void mouseExited(MouseEvent e){
        
    }
    
    public void mouseEntered(MouseEvent e){
        
    }
    
    public void mouseReleased(MouseEvent e){
        
    }
    
    public void mousePressed(MouseEvent e){
        
        
    }

    private void setPage(String page) {
        this.name= page;
    }
}
